{% extends 'admin/base.html' %}

{% block content %}
    <div class="tpl-content-wrapper">
        <div class="tpl-content-page-title"></div>
            <div class="tpl-portlet-components">
                <div class="portlet-title">
                    <div class="caption font-green bold">
                        <span class="am-icon-code"></span>爬虫编辑
                    </div>
                </div>

                <div class="tpl-block">

                    <div class="am-g">
                        <div class="tpl-form-body tpl-form-line">
                            <form class="am-form tpl-form-line-form" method="post" enctype="multipart/form-data">
                            {{ form.csrf_token }}
                                <div class="am-form-group">
                                    <label for="user-name" class="am-u-sm-3 am-form-label">名字 <span class="tpl-form-line-small-title">Name</span></label>
                                    <div class="am-u-sm-9">
                                        {{ form.name(class="tpl-form-input") }}
                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <label for="user-phone" class="am-u-sm-3 am-form-label">分类 <span class="tpl-form-line-small-title">Category</span></label>
                                    <div class="am-u-sm-9">
                                        {{ form.category }}
                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <label class="am-u-sm-3 am-form-label">频率 <span class="tpl-form-line-small-title">Rate</span></label>
                                    <div class="am-u-sm-9">
                                        {{ form.rate }}
                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <label class="am-u-sm-3 am-form-label">数据源 <span class="tpl-form-line-small-title">Source</span></label>
                                    <div class="am-u-sm-9">
                                        {{ form.source }}
                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <label class="am-u-sm-3 am-form-label">家族标签 <span class="tpl-form-line-small-title">Slug</span></label>
                                    <div class="am-u-sm-9">
                                        {{ form.slug }}
                                    </div>
                                </div>


                                <div class="am-form-group">
                                    <label class="am-u-sm-3 am-form-label">标签 <span class="tpl-form-line-small-title">Tag</span></label>
                                    <div class="am-u-sm-9">
                                        {{ form.tag }}
                                    </div>
                                </div>


                                <div class="am-form-group">
                                    <label class="am-u-sm-3 am-form-label">类型 <span class="tpl-form-line-small-title">Type</span></label>
                                    <div class="am-u-sm-9">
                                        {{ form.type }}
                                    </div>
                                </div>


                                <div class="am-form-group">
                                    <label for="user-weibo" class="am-u-sm-3 am-form-label">封面图 <span class="tpl-form-line-small-title">Images</span></label>
                                    <div class="am-u-sm-9">
                                        <div class="am-form-group am-form-file">
                                            {% if cra %}
                                            <div class="tpl-form-file-img">
                                                <img src="{{ url_for('poly.get_cover', filename=cra.image) }}" alt="">
                                            </div>
                                            {% endif %}
                                            <button type="button" class="am-btn am-btn-danger am-btn-sm">
                                            <i class="am-icon-cloud-upload"></i> 添加封面图片</button>
                                            {{ form.image }}
                                        </div>

                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <label for="user-weibo" class="am-u-sm-3 am-form-label">描述 <span class="tpl-form-line-small-title">Describe</span></label>
                                    <div class="am-u-sm-9">
                                        {{ form.describe(rows="10") }}
                                        <div>
                                        </div>
                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <div class="am-u-sm-9 am-u-sm-push-3">
                                        {{ form.submit(class="am-btn am-btn-primary tpl-btn-bg-color-success") }}
                                    </div>
                                </div>
                            </form>

                        </div>
                    </div>
                </div>


            </div>










        </div>
{% endblock %}